{template modoer_header}
<script type="text/javascript" src="{URLROOT}/static/javascript/item.js"></script>
<div id="body">
    <div class="link_path">
        <em>
            <!--{loop $links $i $link}-->
            {if $i}<span class="xsplit">|</span>{/if}
            <a href="$link[url]"{if $link[flag]=='group'} style="color:#ff6600;"{/if}>$link[title]</a>
            <!--{/loop}-->
        </em>
        <a href="{url modoer/index}">{lang global_index}</a>&raquo;&nbsp;{print implode('&nbsp;&raquo;&nbsp;', $urlpath)}
    </div>

    <div class="discussion_left">
        <div class="mainrail">
            <div class="topic_title_total">
                <h3 class="rail-h-3 rail-h-bm-3">
                    <span class="icomoon icon-bubbles2"></span>
                    小组话题 <span class="font_3">($total)</span>
                </h3>   
                <ul class="topic_type_tab">
                    <li><a href="#post"><span class="icomoon icon-bubble2"></span>发布话题</a></li>
                    <li$active['all']><a href="{url group/$gid}">全部</a></li>
                    <li$active['digest']><a href="{url group/$gid/pr/1}">精华</a></li>
                    {get:group val=topic_type(gid/$gid)}
                    <li$active['typeid'][$val[typeid]]><a href="{url group/$gid/pr/{$digest}_$val[typeid]}">$val[name]</a></li>
                    {/get}
                </ul>
                <div class="clear"></div>      
            </div>

            <!--{if $postaccess=='3'}-->
            <div class="messageborder">目前小组处在只读模式，除组长外，其他小组成员无法发布话题。</div>
            <!--{/if}-->
            <!--{dbres $list $val}-->
            <div class="topiclist" id="topiclist">
                <!--{if ($readaccess && $gmember[status])||!$readaccess}-->
                <ul>
                    <li class="face">
                        <a href="{url space/index/uid/$val[uid]}" title="$val[username]" target="_blank"><img src="{print get_face($val[uid])}" /></a>
                    </li>
                    <li class="body" params='{"tpid":$val[tpid]}'>
                        <div class="subject">
                            {if $val[typeid]>0}[<a href="{url group/$gid/pr/{$digest}_$val[typeid]}">{$val[typename]}</a>]{/if}
                            <a title="$val[subject]" href="{url group/topic/id/$val[tpid]}">$val[subject]</a>
                            {if $val[top]}<img src="{URLROOT}/static/images/common/top.gif" title="置顶" />{/if}
                            {if $val[digest]}<img src="{URLROOT}/static/images/common/digest.gif" title="精华" />{/if}
                            {if $val[source]}<img src="{URLROOT}/static/images/common/mobile.gif" title="手机发布" />{/if}
                        </div>
                        <div class="info">
                            <strong><a href="{url space/index/uid/$val[uid]}" target="_blank">$val[username]</a></strong>
                            · {date $val[dateline],'w2style'}发布
                            {if $val[replytime]}· 最后回复 {date $val[replytime],'w2style'}{/if}
                            {if $gmember[usertype]=='1'}
                            <span id="op_topic{$val[tpid]}" class="none">
                                ·  <a href="javascript:;" onclick="discussion_topic_delete($val[tpid]);">删除</a>
                                ·  <a href="javascript:;"onclick="group_topic_top($val[tpid]);">{if !$val[top]}设置顶{else}取消置顶{/if}</a>
                                ·  <a href="javascript:;"onclick="group_topic_digest($val[tpid]);">{if !$val[digest]}设精华{else}取消精华{/if}</a>
                            </span>
                            {/if}
                        </div>
                    </li>
                    <li class="replies"><span>{$val[replies]}</span></li>
                </ul>
                <div class="clear"></div>
                <!--{else}-->
                <div class="messageborder">只有小组成员才能浏览，请先加入小组。</div>
                <!--{/if}-->
            </div>
            <!--{/dbres}-->
            <script type="text/javascript">
            $('#topiclist li.body').each(function(i) {
                $(this).mouseover(function(){
                    $(this).find('span').show();
                }).mouseout(function(){
                    $(this).find('span').hide();
                });
            });
            </script>
            <div class="clear"></div>
            <!--{if $multipage}--><div class="multipage">$multipage</div><!--{/if}-->
            <!--{if !$total}-->
            <div class="messageborder">没有任何话题，<a href="#newtopic">我来发布第一个</a>。</div>
            <!--{/if}-->
        </div>

        <div class="mainrail mt10">
            <a name="post"></a>
            <h3 class="rail-h-3 rail-h-bm-3">发布话题</h3>
            <div class="discussion_post" style="margin-top:10px;">
                <!--{if $postaccess=='3' && $gmember['usertype'] != '1'}-->
                <div class="messageborder">目前小组处在只读模式，无法发布话题。</div>
                <!--{elseif !$gmember && $postaccess!='2'}-->
                <div class="messageborder">只有小组成员才能发言，请先加入小组。</div>
                <!--{elseif $gmember['status'] == '0'}-->
                <div class="messageborder">您目前正在等待审核，无法进行发言。</div>
                <!--{elseif $gmember['status'] == -1}-->
                <div class="messageborder">您目前正在禁言期（截止 {date $gmember[bantime],'Y-m-d'}），无法进行发言。</div>
                <!--{elseif ($postaccess=='1'&&$gmember[usertype]>0)||$postaccess=='2'||($postaccess=='3'&&$gmember[usertype]=='1')}-->
                <script type="text/javascript" src="{URLROOT}/static/javascript/validator.js"></script>
                <form action="{url group/member/ac/topic/op/post}" method="post" name="myform" onsubmit="return validator(this);">
                    <input type="hidden" name="gid" value="$gid">
                    <table border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>
                                <input type="text" class="t_input" style="width:99%;" name="subject" validator="{'empty':'N','errmsg':'请填写话题标题'}" {if !$user->isLogin} onfocus="dialog_login();"{/if} >
                            </td>
                            <td>
                                {if $needtypeid>=1 && $typecount>0}
                                {eval $_G['loader']->helper('form','group');}
                                &nbsp;<select name="typeid">
                                    <option>=话题分类=</option>
                                    {print form_group_type($gid)}
                                </select>
                                {if $needtypeid=='2'}<span class="font_3">必选</span>{/if}
                                {/if}
                            </td>
                        </tr>
                        <tr>
                            <td width="500">
                                <textarea name="content" id="topic_content" style="width:99%;" validator="{'empty':'N','errmsg':'请填写话题内容'}"{if !$user->isLogin} onfocus="dialog_login();"{elseif $MOD[topic_seccode]}onfocus="show_seccode();"{/if}></textarea>
                            </td>
                            <td width="*" valign="top">
                                <div class="smilies">
                                    <!--{loop $smilies $value}-->
                                    <img src="{URLROOT}/static/images/smilies/{$value}.gif" width="20" height="20" onclick="insert_smilies('topic_content','$value');" />
                                    <!--{/loop}-->
                                </div>
                            </td>
                        </tr>
                        <!--{if $user->isLogin}-->
                        <tr>
                            <td colspan="2">
                                <div id="topic_images_foo">
                                    <span class="update-img-ico"><a href="javascript:;" onclick="discuss_topic_upimg('topic_content');">上传图片</a></span>
                                    <span class="update-video-ico"><a href="javascript:;" onclick="group_topic_video('topic_content');">添加视频</a></span>
                                </div>
                            </td>
                        </tr>
                        <!--{/if}-->
                        <!--{if $MOD[topic_seccode] && $user->isLogin}-->
                        <tr>
                            <td><div id="seccode" class="none" style="float:left;width:80px;position:relative;top:-3px;"></div>
                                <input type="text" name="seccode" class="t_input" style="width:118px;" onblur="check_seccode(this.value);" onfocus="show_seccode();" validator="{'empty':'N','errmsg':'请输入注册验证码'}" />
                                <span id="msg_seccode" class="formmessage none"></span>
                            </td>
                        </tr>
                        <!--{/if}-->
                        {if $user->isLogin} 
                        <tr>
                            <td colspan="2"><button type="submit" name="dosubmit">加上去</button></td>
                        </tr>
                        {/if}
                    </table>
                </form>
                <!--{else}-->
                <div class="messageborder">只有小组成员才能发言，请先<a href="javascript:;"onclick="group_join($group[gid]);">加入小组</a>。{if !$user->isLogin}目前您没有登录网站，请先<a href="javascript:;"onclick="dialog_login();">登录</a>。{/if}</div>
                <!--{/if}-->
            </div>
        </div>
    </div>

    <div class="discussion_right">

        <!--{if $subject}-->
        <script type="text/javascript">loadscript('item');</script>
        <div class="mainrail rail-border-3 mb10">
            <h2 class="rail-h-2"><b><a href="{url item/detail/id/$subject[sid]}"><span class="font_2">$subject[name]&nbsp;$subject[subname]</span></a></b></h2>
            <div class="side_subject">
                <!--{eval $reviewcfg = $_G['loader']->variable('config','review');}-->
                <p class="start start{print get_star($subject[avgsort],$reviewcfg[scoretype])}"></p>
                <table class="side_subject_field_list" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td colspan="2"><span class="font_2">$subject[reviews]</span>点评,
                        <span class="font_2">$subject[guestbooks]</span>留言,
                        <span class="font_2">$subject[pageviews]</span>浏览</td>
                    </tr>
                    $subject_field_table_tr
                </table>
            </div>
        </div>
        <!--{/if}-->

        <div class="mainrail rail-border-3">
            {template group_side_info}

            <!--{if $group[members]>0}-->
            <div class="mainrail">
                <h2 class="rail-h-3 rail-h-bt-3">最近加入</h2>
                <ul class="rail-faces">
                    <!--{get:modoer val=table(table/dbpre_group_member/where/gid='$gid' AND status=1/orderby/jointime DESC/rows/9)}-->
                    <li>
                        <div><a href="{url space/index/uid/$val[uid]}"><img src="{print get_face($val[uid])}" /></a></div>
                        <span><a href="{url space/index/uid/$val[uid]}" target="_blank">$val[username]</a></span>
                    </li>
                    <!--{getempty(val)}-->
                    <li>暂无信息</li>
                    <!--{/get}-->
                </ul>
                <div class="clear"></div>
            </div>
            <!--{/if}-->

        </div>

    </div>

    <div class="clear"></div>

</div>
<!--{eval footer();}-->